package com.sinog.biz.service.business.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sinog.biz.mapper.havexml.statistic.StatisticMapper;
import com.sinog.biz.service.business.StatisticService;
import com.sinog.core.util.MapUtil;
import com.sinog.core.util.PageReturnUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Map;

/**
 * @desc 之前系统全部统计分析 - StatisticServiceImpl
 * @author -
 * @date -
 */
@Slf4j
@Service
public class StatisticServiceImpl implements StatisticService {
    @Resource
    private StatisticMapper statisticMapper;

    /**
     * 查询文件列表信息
     * @param pageIndex pageIndex
     * @param pageSize pageSize
     * @param mapkey mapkey
     * @return String
     */
    @Override
    public String getFilesInfoList(Integer pageIndex,Integer pageSize,Map<String,Object> mapkey) {
        Map<String,Object> conversionToMap = MapUtil.requestConversionToMap(mapkey);
        if(conversionToMap.isEmpty()) {
            return null;
        }
        Page<Map<String,String>> page = new Page<>(pageIndex + 1,pageSize);
        page = page.setRecords(statisticMapper.getFilesInfoList(page,mapkey));
        return PageReturnUtil.pageReturn(page);
    }
}